import {
    createStore,
    applyMiddleware,
    combineReducers

} from "redux"
import countReducers from "./reducers/countReducers"
import movieReducer from "./reducers/movieReducer"

import thunk from "redux-thunk"


// console.log("store调用了",movieReducer);

//使用redux提供的combineReducer方法合并多个reducer,用对象保存
const allReducer = combineReducers({
    movie: movieReducer,
    count: countReducers
})
//创建store,参数一是reducer初始值,参数二是处理dispatch传递过来的函数
const store = createStore(allReducer,applyMiddleware(thunk))

//暴露
export default store